home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 1 / QRZ Ham Radio Callsign Database - December 1993.iso / ucsd / packet / tcpip / sys5 / iscwmpst.z / iscwmpst / tcp / isc-src / util / genupd < prev    next >
Encoding:
Text File  |  1991-10-29  |  1.2 KB  |  72 lines

  1. #! /bin/csh -f
  2.  
  3. # @(#) $Header: genupd,v 1.1 91/04/16 11:41:05 deyke Exp $
  4.  
  5. set newdir=/users/funk/dk5sg/tcp
  6. set olddir=/users/funk/dk5sg/tcp.$1
  7.  
  8. cd $newdir
  9. sort /usr/local/lib/users > users.$$
  10. mv users.$$ users
  11. set files=()
  12. foreach i ( \
  13.     Makefile \
  14.     convers/*.[ch] \
  15.     convers/Makefile \
  16.     hosts \
  17.     net.rc.$1 \
  18.     src/*.[ch] \
  19.     src/Makefile \
  20.     users \
  21.     util/*.[ch] \
  22.     util/Makefile \
  23.     util/genupd \
  24.     )
  25.   if ( ! { cmp -s $i $olddir/$i } ) then
  26.     set files=($files $i)
  27.   endif
  28. end
  29.  
  30. cd $olddir
  31. set remove=()
  32. foreach i (`find * -print`)
  33.   if ( ! -e $newdir/$i ) then
  34.     set remove=($remove $i)
  35.     if ($i:e == c) then
  36.       set remove=($remove $i:r.o)
  37.     endif
  38.   endif
  39. end
  40.  
  41. echo 'check() {'
  42. echo '  touch $1'
  43. echo '  if test "`vitals - < $1`" != "$2" ; then'
  44. echo '    echo ERROR: vitals shows wrong numbers for $1 $3 updating.'
  45. echo '    echo Update aborted.'
  46. echo '    exit 1'
  47. echo '  fi'
  48. echo '}'
  49.  
  50. cd $olddir
  51. foreach i ($files)
  52.   touch $i
  53.   echo check $i \'"`vitals - < $i`"\' before
  54. end
  55.  
  56. foreach i ($files)
  57.   echo echo Updating $i
  58.   echo ex - $i "<<'@EOF'"
  59.   diff -e $i $newdir/$i
  60.   echo x
  61.   echo @EOF
  62.   echo check $i \'"`vitals - < $newdir/$i`"\' after
  63. end
  64.  
  65. foreach i ($remove)
  66.   echo echo Removing $i
  67.   echo rm -rf $i
  68. end
  69.  
  70. echo echo Update complete, no errors.
  71. echo exit 0
  72.